//
//  SNSummaryInfoCell.m
//  ZhuoxinAgriculture
//
//  Created by stone on 16/12/28.
//  Copyright © 2016年 stone. All rights reserved.
//

#import "SNSeedCell.h"
#import "UIImageView+TapGesture.h"
#import "IQUIView+IQKeyboardToolbar.h"
//=****** add class ****************** stone ***
@interface SNSeedButton : UIButton

@end

@implementation SNSeedButton

//sn_note:=========  ============================ stone 🐳 ===========/
-(void)setHighlighted:(BOOL)highlighted{
    
}

@end
//=************************ stone ***
@interface SNSeedCell()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet SNSeedButton *iconButton;
@property (weak, nonatomic) IBOutlet UILabel *importanceLabel;
/** previousTypeName */
@property (nonatomic,copy) NSString * previousTypeName;

/** View */
@property (weak, nonatomic) UIView * bgView;
@end
@implementation SNSeedCell
- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        self.contentView.backgroundColor = HexRGB(0xffffff);
    }
    return self;
}

- (void)configCellWithIndexPath:(NSIndexPath *)indexPath productionPlanListResult:(SNProductionPlanListResult *)productionPlanListResult {
    
    _productionPlanListResult = productionPlanListResult;
    _indexPath = indexPath;
    
    switch (indexPath.section) {
        case 1:
        case 3:
            self.rightTextField.keyboardType = UIKeyboardTypeDecimalPad;
            break;
        default:
            self.rightTextField.keyboardType = UIKeyboardTypeDefault;
            break;
    }
    
    switch (indexPath.section) {
        case 0:
            self.titleLabel.text = @"种植品种";
            self.iconButton.hidden = YES;
            self.rightTextField.hidden = NO;
            self.rightTextField.placeholder = @"手动输入";
            self.rightTextField.text = productionPlanListResult.seedBrand;
            self.importanceLabel.hidden = NO;
            break;
        case 1:
            self.titleLabel.text = @"种子总量";
            
            self.iconButton.hidden = YES;
            self.rightTextField.hidden = NO;
            self.rightTextField.placeholder = @"吨";
            self.rightTextField.text = productionPlanListResult.seedTotal;
            self.importanceLabel.hidden = NO;
            break;
        case 2:
            self.titleLabel.text = @"厂家";
            
            self.iconButton.hidden = YES;
            self.rightTextField.hidden = NO;
            self.rightTextField.placeholder = @"手动输入";
            self.rightTextField.text = productionPlanListResult.seedManu;
            self.importanceLabel.hidden = YES;
            break;
        case 3:
            self.titleLabel.text = @"价格";
            
            self.iconButton.hidden = YES;
            self.rightTextField.hidden = NO;
            self.rightTextField.placeholder = @"元/市斤";
            self.rightTextField.text = productionPlanListResult.seedPrice;
            self.importanceLabel.hidden = NO;
            break;
            
        default:
            break;
    }
}

@end
